<script type='text/javascript' src='{$base_dir}modules/dept_laboratory/js/AJAX_LabQueue.js'></script>
<script src='{$base_dir}js/jquery.tablesorter.min.js' type='text/javascript' ></script>
<script src='{$base_dir}js/jquery.tablesorter.pager.js' type='text/javascript' ></script>
<script src='{$base_dir}js/jquery.contextmenu.r2.packed.js' type='text/javascript' ></script>

<script type='text/javascript'>
{literal}   
$(document).ready(function () {
    $('#reloadLabQueue').bind('click', function() {
        var patientType = $('select#patientType :selected').val();
        if (patientType != null && $.trim(patientType) != '') {
            viewLabQueue(patientType);
        }
    });

    $('select#patientType').bind('change', function() {
        var patientType = $('select#patientType :selected').val();
        if (patientType != null && $.trim(patientType) != '') {
            viewLabQueue(patientType);
        }
    });

    var patientType = $('select#patientType :selected').val();
    if (patientType != null && $.trim(patientType) != '') {
        viewLabQueue(patientType);
       
    }     
    $('table#tableWaitingQueue').tablesorter();   
    $('table#tableInProcessQueue').tablesorter();   
    
});
{/literal}
</script>

<div id='Labqueue'>
	<table cellpadding='0' cellspacing='0'>
	    <tr>
	        <td style='padding-right: 10px; text-transform: uppercase;'>
	            <span class='label' style='font-weight: bold;'>{translate}Patient{/translate} &nbsp;&nbsp;</span>&nbsp;
	            <select id='patientType' style='width: 200px;'>  
	            	{html_options options=$patientType};                  
	            </select>
	        </td>
	        <td>
	            <div id='reload' style='display:none; width: 100px;'>
	                <a style='cursor: pointer' id='reloadLabQueue' title='{translate}Update list of patients{/translate}'><img src='{$base_uri}/images/refresh.png'/></a>                      
	            </div>
	            <div id='innerLoading' style='display:block; width: 100px;'>
	                <img src='{$base_uri}/images/ajax-loader.gif'/>
	            </div>
	        </td>
	    </tr>
	</table>
 
    <div id='waitingQueue' class='queue'>
        <div class='documentListHeader'>
            <span> {translate}Waiting queue{/translate} </span>
        </div>
        <table id='tableWaitingQueue' cellspacing='0' cellpadding='0' class='grid' style='width: 100%'>                       
            <thead>
                <tr>
                    <th>{translate}Order number{/translate}</th>
                    <th>{translate}Patient_1{/translate}</th>
                    <th>{translate}Patient's ID_1{/translate}</th>                              
                    <th>{translate}Assignment{/translate}</th>
                    <th>{translate}Start waiting{/translate}</th>                                                                
                    <th>{translate}From dept{/translate}</th>                            
                </tr>
            </thead>
            <tbody>
            </tbody>
        </table>
        <table class='total_table' cellspacing='0' cellpadding='0' style='width: 100%'>	        
	    </table>
    </div>
                
    <div id='inProcessQueue' class='queue'>
        <div class='documentListHeader'>
            <span> {translate}In-process queue{/translate} </span>
        </div>
        <table id='tableInProcessQueue' cellspacing='0' cellpadding='0' class='grid' style='width: 100%'>                        
            <thead>
                <tr>
                    <th>{translate}Order number{/translate}</th>
                    <th>{translate}Patient_1{/translate}</th>
                    <th>{translate}Patient's ID_1{/translate}</th>                              
                    <th>{translate}Assignment{/translate}</th>
                    <th>{translate}Start processing{/translate}</th>
                    <th>{translate}From dept{/translate}</th>
                    <th>&nbsp;</th>                                                                     
                </tr>
            </thead>
            <tbody>
            </tbody>
        </table>
        <table class='total_table' cellspacing='0' cellpadding='0' style='width: 100%'>            
        </table>
    </div>
</div>    